home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: May 2000
- //
- //
- //
- // Procedure Name:
- // artFluidAttrVerifyGrid
- //
- // Description:
- // You can't paint a fluid property unless that
- // property is simulated using either a DynamicGrid
- // or a StaticGrid. If the user tries to paint a non-
- // grid property, pop up a confirm box
- //
- // This script is tied to the paintFluids tool via:
- //
- // artFluidAttrCtx -e -beforeStrokeCmd "artFluidAttrVerifyAttributeGrid"
- //
- // in artFluidAttrToolScript.mel, which creates the tool.
- //
- // Return Value:
- // None.
- //
- global proc artFluidAttrVerifyGrid( string $current) {
- string $create[];
-
- if( !`exists activeFluidsVerifyGrid` ) {
- source "fluidsVerifyGrid.mel";
- }
-
- if( `activeFluidsVerifyGrid $current $create` ) {
- return;
- }
-
- string $createDynamic = $create[0];
- string $createStatic = $create[1];
-
- // User is trying to paint an attribute that is NOT a grid-valued
- // attribute. Pop up confirm box and give him the option to
- // change it...
- //
- string $gridTypes;
- string $buttons;
-
- // Only need "Yes" button, since there's no choice for
- // Static grids on these attributes...
- //
- if( size( $createStatic ) == 0 ) {
- $gridTypes = "Dynamic ";
- $buttons = ( "-button \"Set to Dynamic\" " +
- "-button \"Cancel\" " +
- "-cancelButton \"Cancel\" " +
- "-defaultButton \"Set to Dynamic\" " +
- "-dismissString \"Cancel\" " );
- } else {
- $gridTypes = "either Dynamic or Static ";
- $buttons = ( "-button \"Set to Dynamic\" " +
- "-button \"Set to Static\" " +
- "-button \"Cancel\" " +
- "-cancelButton \"Cancel\" " +
- "-defaultButton \"Set to Dynamic\" " +
- "-dismissString \"Cancel\" " );
- }
-
- string $currentUI = `substitute "and" $current " and "`;
-
-
- if( !`exists getActiveFluidShapes` ) {
- source "getFluidShape.mel";
- }
-
- string $selFluids[] = `getActiveFluidShapes`;
- string $response = eval( "confirmDialog -title " +
- "\"Cannot paint \'" + $currentUI +
- "\' on " + $selFluids[0] + "\"" +
- "-message \"In order to paint this " +
- "attribute, you must first " +
- "set it to " + $gridTypes +
- "Grid.\" " +
- $buttons );
-
- if( $response == "Set to Dynamic" ) {
- evalEcho( $createDynamic );
- } else if( $response == "Set to Static" ) {
- evalEcho( $createStatic );
- }
- }
-
-